<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib tagdir="/WEB-INF/tags/template" prefix="t" %>

<t:template>
	<jsp:body>
		<div class="contact_form">			
				<div class="form_subtitle">Funcionário</div>
					
					<s:actionmessage />
	                 
					<table class="table" style="width:100%;">
						<thead>
							<tr>
								<th class="title">Nome</th>
								<th class="title">Cargo</th>
								<th class="title">Endereço</th>
								<th class="title">Telefone</th>
								<th class="title">CRMV</th>
								<th class="title">Salário</th>
								<th class="title"></th>
								<th class="title"></th>
							</tr>
						</thead>
					<tbody>
						<c:forEach var="item" items="${listaFuncionarios}">
							<tr>
								<td>${item.dsNome}</td>
								<td>${item.dsCargo}</td>
								<td>${item.dsEndereco}</td>
								<td>${item.dsTelefone}</td>
								<td>${item.dsCRMV}</td>
								<td>${item.vlSalario}</td>
								<td><a href="${pageContext.request.contextPath}/funcionario/update?funcionario.pkCodigo=${item.pkCodigo}" class="button">Alterar</a></td> 

								<td><a href="${pageContext.request.contextPath}/funcionario/delete?funcionario.pkCodigo=${item.pkCodigo}" class="button">Excluir</a></td>
								
							</tr>
						</c:forEach>						
					</tbody>
					</table><br/>				
					
				<div class="form_row">					
					<button onclick="javascript:window.location = '${pageContext.request.contextPath}/funcionario/incluir'" class="button">Incluir</button>
				</div>
		</div>
	</jsp:body>
</t:template>